import { HashRouter,Routes,Route } from "react-router-dom";
import {lazy,Suspense} from 'react'

const Index = lazy(()=>import('../pages/index/index'))
const Home = lazy(()=>import('../pages/home/home'))
const Login = lazy(()=>import('../pages/login/login'))
const Category = lazy(()=>import('../pages/category/category-02'))
const Hook = lazy(()=>import('../pages/hook/demo'))
const Cart = lazy(()=>import('../pages/cart/cart'))
const Enroll = lazy(()=>import('../components/百度注册/enroll'))

const App = ()=>(
    <HashRouter>
        <Suspense fallback={<h2>Loading...</h2>}>
            <Routes>
                <Route path="/" element={<Index />}>
                    <Route path="/" element={<Home />}></Route>
                    <Route path="/category/:id" element={<Category />}></Route>
                    <Route path="/cart" element={<Cart /> }></Route>
                </Route>
                <Route path="/login" element={<Login />}></Route>
                <Route path="/enroll" element={<Enroll/>}></Route>
            </Routes>
        </Suspense>
    </HashRouter>
)
export default App;